#include "acq_task.h"

namespace iot_acq {
void AcqTask::OnEvent(void* args) {}

void AcqTask::OnTimer(void* args) {
    for (auto &pair : mapRpc_) {
        std::shared_ptr<leoyun::YunRpc> rpc = pair.second;
        if (rpc == nullptr) {
            HTELINK_LOG_INFO("sth error about %s", pair.first.c_str());
            continue;
        }
        rpc->Run();
    }
}

void AcqTask::OnShot(void* args) {}
void AcqTask::PushRpc(const std::string& name,
                      std::shared_ptr<leoyun::YunRpc> rpc) {
    mapRpc_.insert(std::pair<std::string, std::shared_ptr<leoyun::YunRpc>>(name, rpc));
}
}  // namespace iot_acq
